//
//  CellOfAudioClass.m
//  To Feel
//
//  Created by dllo on 16/7/15.
//  Copyright © 2016年 caoyu. All rights reserved.
//

#import "CellOfAudioClass.h"
#import "Masonry.h"
#import "ModelOfAudioClassify.h"
#import "UIImageView+WebCache.h"
@interface CellOfAudioClass ()



@end

//UILabel *_headtitle;
//UIImageView *_imgOne;
//UIImageView *_imgTwo;
//UIImageView *_imgThree;
//UILabel *_desc1;
//UILabel *_desc2;
//UILabel *_desc3;

@implementation CellOfAudioClass

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        [self initSubcontrols];
    }
    
    return self;
}

- (void)setModel:(ModelOfAudioClassify *)model {
    
    NSDictionary *dic1 = [model.list objectAtIndex:0];
    NSDictionary *dic2 = [model.list objectAtIndex:1];
    NSDictionary *dic3 = [model.list objectAtIndex:2];
    

    self.title.text = model.title;

    self.introOne.text = [dic1 objectForKey:@"intro"];
    self.introTwo.text = [dic2 objectForKey:@"intro"];
    self.introThree.text = [dic3 objectForKey:@"intro"];
    
    
    
}

- (void)initSubcontrols {
     self.title = [[UILabel alloc] init];
    [self.contentView addSubview:self.title];
    self.title.font = [UIFont systemFontOfSize:14];
    self.title.numberOfLines = 0;

    [self.title mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.contentView).with.offset(20);
        make.left.equalTo(self.contentView).with.offset(10);
        make.height.offset(17);
        make.width.offset(100);
        
    }];
    
  self.introOne = [[UILabel alloc] init];
    [self.contentView addSubview:self.introOne];
    self.introOne.font = [UIFont systemFontOfSize:12];
    self.introOne.numberOfLines = 0;
    
    [self.introOne mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.contentView).with.offset(-5);
        make.left.equalTo(self.contentView).with.offset(10);
        make.width.offset(120);
        make.height.offset(30);
    }];
     
  self.introTwo = [[UILabel alloc] init];
    [self.contentView addSubview: self.introTwo];
    self.introTwo.font = [UIFont systemFontOfSize:12];
    self.introTwo.numberOfLines = 0;
//     self.introTwo.backgroundColor = [UIColor yellowColor];
    
    [ self.introTwo mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.contentView).with.offset(-5);
        make.left.equalTo(self.introOne.mas_right).with.offset(15);
        make.width.offset(120);
        make.height.offset(30);
    }];

    self.introThree = [[UILabel alloc] init];
    [self.contentView addSubview:self.introThree];
    self.introThree.font = [UIFont systemFontOfSize:12];
    self.introThree.numberOfLines = 0;
    
    [self.introThree mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.contentView).with.offset(-5);
        make.left.equalTo(self.introTwo.mas_right).with.offset(15);
        make.width.offset(120);
        make.height.offset(30);
    }];

    self.viewOfCollec = [[UIView alloc] init];
    [self.contentView addSubview:self.viewOfCollec];
    [self.viewOfCollec mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.title.mas_bottom).with.offset(20);
        make.left.equalTo(self.contentView).with.offset(0);
        make.right.equalTo(self.contentView).with.offset(0);
        make.height.mas_offset(120);
    }];
}


@end
